<?php
namespace Home\Controller;

class DeviceController extends HomeController {
    public function lists(){
    	$device = D("DocumentApparatus")->join('opto_lab_document ON opto_lab_document_apparatus.id=opto_lab_document.id')->where('status=1')->select();
    	$this->assign("device", $device);
    	// var_dump($device);
        $this->display();
    }
    public function detail($id){
		if(!isset($id) || empty($id)) $this->error("No ID");
		$device = D("DocumentApparatus")->join('opto_lab_document ON opto_lab_document_apparatus.id=opto_lab_document.id')->where("status=1 AND opto_lab_document_apparatus.id='$id'")->select();
		if(!$device) $this->error("错误的ID");
		//var_dump($device);
		$this->assign("device",$device[0]);
    	$this->display();
    }
}